@extends('/home.layout.index')
@section('title','话题广场')
@section('con')
	<?php  session_start(); ?>	
	
	<div class="zg-wrap zu-main clearfix " role="main">
    <div class="zu-main-content">
        <div class="zu-main-content-inner">
            <div class="zm-topic-cat-page">
                <div class="zm-topic-cat-title">
                    <a href="/people/TOP-ACE/topics" class="zg-link-gray zg-right">
                        <span>已关注 12 个话题</span></a>
                    <h2>
                        <i class="zg-icon zg-icon-topic-square"></i>话题广场</h2>
                </div>
                
                <!-- {{var_dump($data)}} -->
                <div class="zm-topic-cat-sub">
                    <div class="zh-general-list clearfix" data-init="{&quot;params&quot;: {&quot;topic_id&quot;: 253, &quot;offset&quot;: 0, &quot;hash_id&quot;: &quot;000f0ccb085b150db458a690ba510cc9&quot;}, &quot;nodename&quot;: &quot;TopicsPlazzaListV2&quot;}" style="display: block;">
                        @foreach($data as $k=>$v)
                        <div class="item">
                            <div class="blk">
                                <p target="_blank" href="">
                                    <img src="{{$v->pic}}" alt="{{$v->title}}">
                                    <a href="#">{{$v->title}}</a>
	                                <a id="{{$v->id}}" href="javascript:;" class="follow"><i class="follow"></i>关注</a>
	                                <a style="display:none;" id="{{$v->id}}" href="javascript:;" class="block">取消关注</a>
                                 </p>
                                <p>{{$v->content}}</p>
                                <span class=hqid tid="{{$v->id}}"></span>
                            </div>
                        </div>
                   		@endforeach
                    </div>
                    <script src="/homeCSS/js/jquery-1.8.3.min.js" type="text/javascript"></script>
					<script type="text/javascript">
						//绑定关注单击事件
						$('.follow').click(function(){
							var tid=$(this).attr('id');//获取tid
							var hh=$(this);
							//然后发送ajax  通过把值给添进去
							 $.ajax({
						        type: "get",
						        url: '/home/topic/topic/intopic',
						        data: {"tid":tid},
						        success: function (data)
						        {
						           if(data) {
						           	hh.siblings('a').show();
						           	hh.hide();

						           };
						        },
						        
						     });
						})
						// 绑定取消关注单击事件
						$('.block').click(function(){

							var tid=$(this).attr('id');//获取tid
							var zz=$(this);

							//然后发送ajax  通过把值给添进去
							 $.ajax({
						        type: "get",
						        url: '/home/topic/topic/detopic',
						        data: {"tid":tid},
						        success: function (data)
						        {
						           if(data) {
						           	zz.siblings('a').show();
						           	zz.hide();

						           };
						        },
						        
						     });

						})
							// $('.follow').click(function() {
							// 	var tid=$(this).attr('id');//获取tid
							//     var $this = $(this);
							//     $this.data('value',$this.text()).text('Loading');
							//     $this.hasClass('active')?
							//         $.get('/home/topic/topic/intopic',{id: 'tid'},function(data){
							//             if(success){
							//                 $this.text('关注').removeClass('active');
							//             } else {
							//                 $this.text($this.data('value'));
							//             }
							//         }:
							//         $.get('/home/topic/topic/detopic',{id:'tid'},function(display){
							//             if(success){
							//                 $this.text('已关注').addClass('active');
							//             } else {
							//                 $this.text($this.data('value'));
							//             }
							//         });
							// });
													
					</script>
                    <a aria-role="button" class="zg-btn-white zu-button-more">更多</a>
                    <a href="javascript:;" id="zh-load-more" data-method="next" class="zg-btn-white zg-r3px zu-button-more" style="display:none">更多</a></div>
            </div>
            	
        </div>
    </div>
    <div class="zu-main-sidebar" data-za-module="RightSideBar">
        <div class="zm-side-section explore-side-section">
            <div class="zm-side-section-inner">
                <div class="section-title">
                    <h3>广告区:	请期待...</h3></div>
                <ul class="list hot-topics">
                    <li class="clearfix">
                        <a target="_blank" class="avatar-link" href="#" data-hovercard="t$b$19654108">
                            <img src="" alt="损瑟" class="avatar 40"></a>
                        <div class="content">
                            <a href="#" target="_blank" data-hovercard="t$b$19654108">你想让自己变得更帅吗?</a>
                            <div class="meta">
                                <span>编号TBJ0110007</span></div>
                        </div>
                        <div class="bottom">
                            <a class="question_link" href="#" target="_blank" data-id="15547770" data-za-element-name="Title">如何看待迷倒万千少女这种亮瞎眼的事件？</a></div>
                    </li>
                   
                </ul>
            </div>
        </div>
        <div id="zh-footer" class="zh-footer">
            <div class="content zg-wrap clearfix">
                <ul>
                    <li>
                        <a href="#" target="_blank">刘看山</a></li>
                    <li>
                        <a href="#" target="_blank">知乎指南</a></li>
                    <li>
                        <a href="#" id="js-feedback-button">建议反馈</a></li>
                    <li>
                        <a href="#" target="_blank">移动应用</a></li>
                    <li>
                        <a href="#">加入知乎</a></li>
                    <li>
                        <a href="#" target="_blank">知乎协议</a></li>
                    <li>
                        <a href="#" target="_blank">举报投诉</a></li>
                    <li>
                        <a href="#">联系我们</a></li>
                </ul>
                <span class="#">&copy; 2017 知乎</span></div>
        </div>
    </div>
</div>
@endsection

@section('pljs')
<!-- 关注==取消关注 -->

	
@endsection		    